﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace Vit.Web.DataAnnotations
{
    public class RequiredModelValidator : DataAnnotationsModelValidator<RequiredAttribute>
    {
        public RequiredModelValidator(ModelMetadata metadata, ControllerContext context, RequiredAttribute attribute)
            : base(metadata, context, attribute)
        {
        }


        public override IEnumerable<ModelClientValidationRule> GetClientValidationRules()
        {
            return new ModelClientValidationRule[] 
            { 
                new ModelClientValidationRequiredRule(base.ErrorMessage) 
            };
        }
    }
}
